﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Text;
using System.Windows.Forms;

namespace FieldServices
{
    public partial class frmNotificationDetail : UIFramework.UIForm
    {
        public frmNotificationDetail()
        {
            InitializeComponent();
        }
        private string _OrderID;
        private DataTable dt;
        public frmNotificationDetail(string OrderID)
        {
            InitializeComponent();
            this._OrderID = OrderID;
            DisPlayNotification(this._OrderID);
        }
        private void DisPlayNotification(string OrderID)
        {
            DataSet ds = Common.dsItems;
            dt = ds.Tables[1];
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (dt.Rows[i]["ORDERID"].ToString() == OrderID)
                {
                    this.lbl_OrderID.Text = dt.Rows[i]["ORDERID"].ToString();
                    this.lblCity.Text = dt.Rows[i]["CITY"].ToString();
                    this.lblCountry.Text = dt.Rows[i]["COUNTRY"].ToString();
                    this.lblName.Text = dt.Rows[i]["NAME"].ToString();
                    this.lblNotifNo.Text = dt.Rows[i]["NOTIF_NO"].ToString();
                    this.lblPartner.Text = dt.Rows[i]["PARTNER"].ToString();
                    this.lblPosCode.Text = dt.Rows[i]["POSTL_CODE"].ToString();
                    this.lblPriority.Text = dt.Rows[i]["PRIORITY"].ToString();
                    this.lblPriotype.Text = dt.Rows[i]["PRIOTYPE"].ToString();
                    this.lblShortText.Text = dt.Rows[i]["SHORT_TEXT"].ToString();
                    this.lblStreet.Text = dt.Rows[i]["STREET"].ToString();
                    this.lblTelephone.Text = dt.Rows[i]["TELEPHONE"].ToString();
                    this.lblTelephone2.Text = dt.Rows[i]["TELEPHONE2"].ToString();
                    this.lblPriokx.Text = dt.Rows[i]["PRIOKX"].ToString();                   
                }
            } 
        }
        private void frmNotificationDetail_KeyDown(object sender, KeyEventArgs e)
        {
            if ((e.KeyCode == System.Windows.Forms.Keys.Up))
            {
                // Up
            }
            if ((e.KeyCode == System.Windows.Forms.Keys.Down))
            {
                // Down
            }
            if ((e.KeyCode == System.Windows.Forms.Keys.Left))
            {
                // Left
            }
            if ((e.KeyCode == System.Windows.Forms.Keys.Right))
            {
                // Right
            }
            if ((e.KeyCode == System.Windows.Forms.Keys.Enter))
            {
                // Enter
            }
        }
        private void pictureBox3_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void pictureBox2_Click(object sender, EventArgs e)
        {
            frmWorkItems Src_WorkItem = new frmWorkItems();
            Src_WorkItem.Show();
        }         
    }
}


